// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import './assets/global.css'
import md5 from 'js-md5' //引入
//  axios.defaults.withCredentials = false;
Vue.prototype.$md5 = md5;//添加
// Vue.config.productionTip = false
Vue.use(router)
Vue.use(Element)

Vue.prototype.$http = axios

Vue.prototype.$message = Element.Message
Vue.prototype.$confirm = Element.MessageBox.confirm


new Vue({
  el: '#app',
  render: h => h(App),//Elementui
  router,
  template: '<App/>'
})

// axios.interceptors.request.use(config => {
//   var token = window.localStorage.getItem("token")
//   if (token != "") {
//     config.headers['Authorization'] = 'Bearer ' + token
//   }
//   return config
// },
//   err => {
//     console.log(err)
//     return Promise.reject(err)
//   });

